﻿<?php
include_once('TaiKhoanDAO.php');
$Username = $_GET['id'];
$LoaiTK = TaiKhoanDAO::LayLoaiTaiKhoan($Username);
$KQ = TaiKhoanDAO::XoaTaiKhoan($Username );
$Loai = $LoaiTK->tk_loai;
if($Loai == 0)
{
	$result = TaiKhoanDAO::DanhSachTaiKhoanNguoiBan();
}
else
{
	$result = TaiKhoanDAO::DanhSachTaiKhoanNguoiMua();
}
for($i = 0 ; $i < count($result) ; $i++)
{
	$row = $result[$i];
	echo"<tr>";
		echo"<td style='background: #d1d1d1;'>$row->tk_ho_ten</td>";
		echo"<td style='background: #d1d1d1;'><label id='label$i'> $row->tk_username </label></td>";
		echo"<td style='background: #d1d1d1;'>";
		echo"<select name='$i' id='$i' onchange='CapNhatTrangThai(this.value,$i)' >";
			if($row->tk_tinh_trang == 0)
			{
				echo"<option value ='0'>Ðang khóa</option> ";
				echo"<option value ='1'>Ðang Sử Dụng</option>";
			}
			else
			{
				echo"<option value ='1'>Ðang sử dụng</option> ";
				echo"<option value ='0'>Ðang khóa</option> ";
			}
		echo"</select>";
		echo"</td>";
		echo"<td style='background: #d1d1d1;'><a style='cursor:pointer; color: purple;'  title='Xoa' onClick='XoaMotUser($i);' />Xóa Tài Khoản</a></td>";
	echo"</tr>";

}
?>  